using System;
using System.Web;
using System.Web.UI.WebControls;
using Framework.Library.Utilities;

namespace Framework.Module.Logging
{
    public class Loging : Literal
    {
        private string counterkey;

        public string CounterKey
        {
            get { return counterkey; }
            set { counterkey = value; }
        }

        private string counterid = string.Empty;

        public string CounterID
        {
            get { return counterid; }
            set { counterid = value; }
        }

        private int countervalue = 1;

        public int CounterValue
        {
            get { return countervalue; }
            set { countervalue = value; }
        }

        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            Random rdm = new Random();
            Text = "<img src=\"/Modules/Logging/LogCounter.aspx?key=" + CounterKey + "&id=" + CounterID + "&value=" + CounterValue + "&portalid=" + HttpContext.Current.Request.QueryString["portalid"] + "&rand=" + rdm.Next() + "\" width=1 height=1 border=0 alt=\"\"/>";
            //this.Text = "<img src='/Modules/Loging/LogCounter.aspx?key=" + CounterKey + "&id=" + CounterID + "&value=" + CounterValue + "&rand=" + rdm.Next() + "' width=1 height=1 border=0 alt=''>";
        }
    }
}
